// 数组去重
const unique = (arr: any[]) => {
  if (!Array.isArray(arr)) {
    console.log('type error!')
    return
  }
  arr = arr.sort()
  let res = []
  for (let i = 0; i < arr.length; i++) {
    if (arr[i] !== arr[i - 1]) {
      res.push(arr[i])
    }
  }
  return res
}
const CommonFunction = {
  unique
}
export default CommonFunction
